<script setup>
import { provide, ref } from 'vue';
import ParentCom from './components/ParentCom.vue';

const money = ref(78872399)
const payMoney = (count) => {
  money.value -= count
}

// 提供子组件们需要(依赖)的数据
provide('money', money) // 提供数据
provide('payMoney', payMoney) // 提供方法

</script>

<template>
  <div class="yeye">
    <!-- 父组件 -->
    <parent-com></parent-com>
  </div>
</template>

<style scoped>
.yeye {
  width: 600px;
  height: 600px;
  border: 10px solid red;
}
</style>
